const mongoose = require("../config/db");
const PartySchema = mongoose.Schema({
  fullname: {
    type: String,
    required: true,
    minlength: 2,
    maxlength: 12
  },
  age: {
    type: Number,
    require: true
  },
  branch: {
    type: String,
    required: true,
    minlength: 1,
    maxlength: 12
  },
  join_time: {
    type: Date,
    default: Date.now
  },
  zz_time: {
    type: Date,
    default: Date.now
  },
  create_time: {
    type: Date,
    default: Date.now
  },
  update_time: {
    type: Date,
    default: Date.now
  }
},
  {
    versionKey: false,
    timestamps: { createdAt: "create_time", updatedAt: "update_time" }
  }
)
const PartyModel = mongoose.model("Party", PartySchema, "party");
module.exports = PartyModel;